#!/bin/bash
#2022年 08月 16日 星期二 13:36:51 CST
#zzk

cur_dir=$(pwd)
backup=~/.backup2

if [ -d "$backup" ]; then
	echo "Your already got ~/.backup folder."
	echo 'If you wang to change backup folder, just change the "backup" variable'
	exit
fi

# backup 
mkdir -p $backup
mv ~/.vimrc $backup
mv ~/.vim $backup
mv ~/.tmux.conf $backup
mv ~/.tmux.conf.local $backup
# for vscode
mv ~/.config/Code/User/settings.json $backup
mv ~/.config/Code/User/snippets $backup
#mv -r $config/fish.config $backup

# symlink
ln -s "$cur_dir/dotfiles/.vimrc" ~/.vimrc
ln -s "$cur_dir/dotfiles/.vim" ~/.vim
ln -s "$cur_dir/dotfiles/.tmux.conf" ~/.tmux.conf
ln -s "$cur_dir/dotfiles/.tmux.conf.local" ~/.tmux.conf.local
ln -s "$cur_dir/dotfiles/settings.json" ~/.config/Code/User/settings.json
ln -s "$cur_dir/dotfiles/snippets" ~/.config/Code/User/snippets

# for gdb
ln -s "$cur_dir/dotfiles/.for_gdb" ~/.for_gdb

dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:ctrl_modifier']"

# if you want to install oh my fish, just open the code below
# sudo ./installomf
